{% extends '::base.html.twig' %}

{% block body %}
    <h1>{% trans %}global.forum{% endtrans %}</h1>
    {% if categories|length > 0 %}
	{% for category in categories %}
        <h2><a href="{{ path("MeestersForumBundle_CategoryShow", {'id': category.id}) }}">{{ category.name }}</a></h2>
            <table>
                <thead>
                    <tr>
                        <th colspan="2">{% trans %}category.display.field.forums{% endtrans %}</th>
                        <th>{% trans %}category.display.field.topics{% endtrans %}</th>
                        <th>{% trans %}category.display.field.posts{% endtrans %}</th>
                        <th>{% trans %}category.display.field.last_post{% endtrans %}</th>
                    </tr>
                </thead>
                <tbody>
                {% if category.forums|length > 0 %}
                    {% for forum in category.forums %}
                        <tr>
                            <td>X</td>
                            <td>
                                <a href="{{ path('MeestersForumBundle_ForumShow', {'id': forum.id}) }}">
                                    <dl>
                                        <dt>{{ forum.name }}</dt>
                                            <dd>{{ forum.description }}</dd>
                                    </dl>
                                </a>
                            </td>
                            <td>{{ forum.topicCount }}</td>
                            <td>{{ forum.postCount }}</td>
                            <td>laatste</td>
                        </tr>
                    {% endfor %}
                {% else %}
                    <tr>
                        <td colspan="5">
                            <p>{% trans %}category.display.error.empty{% endtrans %}</p>
                        </td>
                    </tr>
                {% endif %}
                </tbody>
            </table>
	{% endfor %}
    {% else %}
	<p>{% trans %}global.error.empty{% endtrans %}</p>
    {% endif %}
{% endblock %}